#include "Speed_Ctrl.h"
#include "stm32f1xx.h"
static uint16_t g_speed=0;
static const uint8_t g_SpeedConv_K= 60/SpeedCheckPeriod_sec/SectorNum/PolePair;/*Convertion coefficient from HALLCNT to speed(rpm)*/
st_Motor_PIDParam Motor_PIDParam = {1,1,0};
void Set_Speed_Rpm(uint16_t speed)
{
  g_speed=speed;
}

uint16_t Get_Speed_Rpm(void)
{
 return g_speed;
}

uint16_t gu16_CalcSpeed_Rpm(uint16_t cnt)
{
  /*n:rpm cnt:How many sector has passed in 1 second*/
  double n;
  n=cnt*g_SpeedConv_K;/*formula:n=cnt/(number of sector)/(polepair)*60*/
  Set_Speed_Rpm(n);
  return n;
}  

void gv_SpeedPID_Task(void)
{


}